package cn.myj2c.executor.providers;

import cn.myj2c.executor.values.JavaValue;
import cn.myj2c.executor.Context;
import org.objectweb.asm.Type;

import java.util.List;

public interface Provider {

    Object invokeMethod(String className, String methodName, String methodDesc, JavaValue targetObject, List<JavaValue> args, Context context);

    boolean instanceOf(JavaValue target, Type type, Context context);

    boolean checkcast(JavaValue target, Type type, Context context);

    boolean checkEquality(JavaValue first, JavaValue second, Context context);

    void setField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Object value, Context context);

    Object getField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Context context);

    boolean canInvokeMethod(String className, String methodName, String methodDesc, JavaValue targetObject, List<JavaValue> args, Context context);

    boolean canCheckInstanceOf(JavaValue target, Type type, Context context);

    boolean canCheckcast(JavaValue target, Type type, Context context);

    boolean canCheckEquality(JavaValue first, JavaValue second, Context context);

    boolean canGetField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Context context);

    boolean canSetField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Object value, Context context);
}
